package Hot100.DP;

import java.util.Stack;

public class longestValidParentheses {
    public static void main(String[] args) {
        String s = "()(()";
        System.out.println(new longestValidParentheses().longestValidParentheses(s));
    }
    public int longestValidParentheses(String s) {
        Stack<Character> stack = new Stack<>();
        int max = 0;
        int[] dp = new int[s.length()];
        dp[0] = 0;
        for (int i = 1; i < s.length(); i++) {
            for (int j = 0; j < i; j++) {
                if(s.charAt(i) == '('){
                    dp[i] = Math.max(dp[j] + 1,dp[i]);
                }
                else {

                }
            }
        }
        return max;
    }
}
